<!-- webpage content -->

<?php
echo "<BR /><BR />";
//$id = 219;

$query = mysql_query("

SELECT `productnummer`, `productnaam`,`image` 
FROM producten
WHERE `cat1`=(SELECT `cat1` FROM producten WHERE `productnummer`=$id)
AND `cat2`=(SELECT `cat2` FROM producten WHERE `productnummer`=$id)
ORDER BY RAND() 
LIMIT 3

",$server);
	echo "<CENTER><B>Gerelateerde producten:</B><table><tr>";
while($row = mysql_fetch_array($query)){
	echo "<td width='200' align='center'><img src='images/producten/thumb_$row[image]'><a href='product.php?id=$row[productnummer]'><BR>$row[productnaam]</a></td>";
	}
echo "</tr></table";


?>

